<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <?php include_http_metas() ?>
    <?php include_metas() ?>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    <?php include_title() ?>
    <link rel="shortcut icon" href="/favicon.ico" />
    <?php include_stylesheets() ?>
    <?php include_javascripts() ?>
  </head>
  <body>
    <div id="header_container">
      <div id="header">
        <table width="100%">
          <tr>
            <td width="50%" height="50px" align="left" valign="middle">
                <!--a href="<?php //echo url_for('@homepage') ?>"><?php //echo image_tag('logo.png','size=109x36') ?></a-->
            </td>
            <td width="50%" align="right" valign="middle">
                <?php echo image_tag('logo_2.png','size=200x28') ?>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <div id="container_background">
      <div id="container">
        <div id="filter">
          <form action="<?php echo url_for('@search') ?>" method="post" id="frm_search" autocomplete="off">
            <table width="700px" cellpadding="5" cellspacing="0" border="1" style="margin: 0 auto;">
              <tr>
                <td width="200px" align="center" style="padding: 3px;">
                  <div class="title_container advertiser">
                      <div class="title">Anunciante</div>
                  </div>
                  <div class="text_field_container advertiser">
                    <div class="text_field">
                        <input type="text" id="advertiser" name="advertiser" value="<?php echo $sf_user->getAttribute('f_advertiser'); ?>" onkeypress="filter_enterPressed(event)" style="width: 228px;" />
                    </div>
                  </div>
                </td>
                <td width="200px" align="center" style="padding: 3px;">
                  <div class="title_container item">
                      <div class="title">Rubro</div>
                  </div>
                  <div class="text_field_container item">
                    <div class="text_field">
                        <input type="text" id="item" name="item" value="<?php echo $sf_user->getAttribute('f_item'); ?>" onkeypress="filter_enterPressed(event)" style="width: 229px;" />
                    </div>
                  </div>
                </td>
                <td width="100px" align="center" style="padding: 3px;">
                  <div class="title_container page">
                      <div class="title">Página</div>
                  </div>
                  <div class="text_field_container page">
                    <div class="text_field">
                        <input type="text" id="yell_page" name="yell_page" size="1" value="<?php echo $sf_user->getAttribute('f_yell_page'); ?>" onkeypress="filter_enterPressed(event)" style="width: 103px;" />
                    </div>
                  </div>
                </td>
                <td width="35px" align="left" valign="middle">
                  <div style="margin: 35px 0 0 5px;">
                    <a href="javascript:void(0)" onclick="submit_filter();">
                        <?php echo image_tag('btn_search.png','size=27x27 title="Buscar"') ?></a>
                  </div>
                </td>
              </tr>
            </table>
          </form>
        </div>
        <div id="content">
            <?php echo $sf_content ?>
        </div>
      </div>
    </div>
    <!--[if gte IE 9]>
  <style type="text/css">
    .gradient {
       filter: none;
    }
  </style>
<![endif]-->
    <script type="text/javascript">
    function log( message ) {
        $( "<div/>" ).text( message ).prependTo( "#log" );
        $( "#log" ).scrollTop( 0 );
    }
    $("#advertiser").autocomplete({
        source: function( request, response ) {
            $.ajax({
                url: "<?php echo url_for('@json_autocomplete_advertiser') ?>",
                dataType: "json",
                data: {
                    advertiser: request.term
                },
                success: function( data ) {
                    response( $.map( data.advertisers, function( item ) {
                        return {
                            label: item.name,
                            value: item.name
                        }
                    }));
                }
            });
        },
        minLength: 1,
        select: function( event, ui ) {
            log( ui.item ?
                "Selected: " + ui.item.label :
                "Nothing selected, input was " + this.value);
        },
        open: function() {
            $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
        },
        close: function() {
            $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
        }
    });
    $("#item").autocomplete({
        source: function( request, response ) {
            $.ajax({
                url: "<?php echo url_for('@json_autocomplete_item') ?>",
                dataType: "json",
                data: {
                    item: request.term
                },
                success: function( data ) {
                    response( $.map( data.items, function( item ) {
                        return {
                            label: item.name,
                            value: item.name
                        }
                    }));
                }
            });
        },
        minLength: 1,
        select: function( event, ui ) {
            log( ui.item ?
                "Selected: " + ui.item.label :
                "Nothing selected, input was " + this.value);
        },
        open: function() {
            $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
        },
        close: function() {
            $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
        }
    });
    </script>
  </body>
</html>
